/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include <xml/Stream.h>
#include <Converter.h>
#include <safe_new.h>
#include "Model.h"

namespace liba
{
namespace lib3d
{
namespace node
{

const Atom Model::shaders_name("Shaders");

Model::Model( const Atom & name, Node * parent )
:	Node( name, parent ),
	shaders( shaders_name )
{}

Model * Model::Clone()
{
	return new Model(*this);
}

bool Model::on_node( xml::Provider * prov, const std::string & name )
{
	if( name == "Shaders" )
		return prov->parse_object( &shaders );
	return Node::on_node( prov, name );
}

animate::Node * Model::FindAnimateNode(const Atom & name, bool recursion)
{
	if( name == shaders.GetName() )
		return &shaders;
	return Node::FindAnimateNode( name, recursion );
}

} // namespace node
} // namespace lib3d
} // namespace liba


